<script setup lang="ts">
import { ref, type Ref } from 'vue'
import { useRoute } from 'vue-router'
import MasonryVideoList from '@/components/MasonryVideoList.vue'
import videoLib from '@/components/videoLib.vue'
import type { getListParams } from '@/apis/video'
import footBar from '@/components/footBar.vue'

const route = useRoute()
const videoLibParms: Ref<getListParams> = ref({ name: route.query?.name } as getListParams)

async function getParms(e: getListParams) {

  e.name = videoLibParms.value.name
  videoLibParms.value = e
}
</script>

<template>
  <div class="valueBox">
    <headerBar :searchValue="route.query?.name" :aways-bg="true" class="headerBar"></headerBar>
    <div class="showPage">
      <div class="showPage-innerBox">
        <div class="searchInfoBox">
          <div class="searchInfoBox-title">
            搜索 "
            <div style="max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #00d1d1;margin: 0 10px;">{{ videoLibParms.name }}</div>
            "，结果 如下
          </div>
        </div>
        <videoLib @getParms="getParms"></videoLib>
        <div class="listBox">
          <MasonryVideoList :video-parms="videoLibParms"></MasonryVideoList>
        </div>
        <footBar></footBar>
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">
.searchInfoBox {
  display: flex;
  align-items: center;
  margin-bottom: 20px;

  &-title {
    font-size: 25px;
    font-weight: bold;
    display: flex;
    color: #fff;
  }
}
.valueBox {
  display: flex;
  position: relative;

  .headerBar {
    position: fixed;
    top: 0;
    // left: 0;
    width: 100%;
    z-index: 999;
    min-width: 1100px;
    max-width: 2376px;
    margin: 0 auto;
  }

  .showPage {
    width: 100%;
    color: #eee;

    &-innerBox {
      max-width: 1450px;
      min-width: 1100px;
      margin: 0 auto;
      margin-top: 90px;
      padding: 30px;
      padding-right: 30px;
      padding-top: 10px;
    }
  }
}
</style>
